local sijun = fk.CreateSkill({
  name = "lvshi__sijun",
})

Fk:loadTranslationTable{
  ["lvshi__sijun"] = "肆军",
  [":lvshi__sijun"] = "当你使用【闪】后或你的黑桃判定牌生效后，你可对当前回合角色造成1点雷电伤害；当其他角色受到雷电伤害后，你回复1点体力。",
  ["#lvshi__sijun-invoke"] = "你可对%src造成1点雷电伤害",
  ["lvshi__heal"] = "回复1点体力",
  ["lvshi__draw1"] = "摸一张牌",
  ["$lvshi__sijun1"] = "黄天挥军，四海皆应！",
}

sijun:addEffect(fk.CardUseFinished, {
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(sijun.name) and target == player and data.card.trueName == "jink"
  end,
  on_cost = function(self, event, target, player, data)
    if player.room.current and not player.room.current.dead then
      return player.room:askToSkillInvoke(player, {
        skill_name = sijun.name, prompt = "#lvshi__sijun-invoke:"..player.room.current.id})
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    if room.current then
      room:damage{
        from = player,
        to = room.current,
        damage = 1,
        damageType = fk.ThunderDamage,
        skillName = sijun.name,
      }
    end
  end,
})

sijun:addEffect(fk.FinishJudge, {
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(sijun.name) and target == player and data.card.suit == Card.Spade
  end,
  on_cost = function(self, event, target, player, data)
    if player.room.current and not player.room.current.dead then
      return player.room:askToSkillInvoke(player, {
        skill_name = sijun.name, prompt = "#lvshi__sijun-invoke:"..player.room.current.id})
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    if room.current then
      room:damage{
        from = player,
        to = room.current,
        damage = 1,
        damageType = fk.ThunderDamage,
        skillName = sijun.name,
      }
    end
  end,
})

sijun:addEffect(fk.Damaged, {
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(sijun.name) and data.damageType == fk.ThunderDamage and target ~= player and player:isWounded()
  end,
  on_cost = Util.TrueFunc,
  on_use = function(self, event, target, player, data)
    player.room:recover({
      who = player,
      num = 1,
      recoverBy = player,
      skillName = sijun.name
    })
  end,
})

return sijun
